const rl = require('readline');

/**
 * 控制台输入功能:
 * 技能点：readline模块
 */

// console.log("hello, node.js!");
/* console.log(195 / 100);
console.log(1 / 3); */

const arr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'];


const random = Math.random();
const index = Math.floor(random * arr.length);

const scanner = rl.createInterface({
    input: process.stdin,
    out: process.stdout
})
const question1 = "你要做什么？"
console.log(question1);
scanner.question(question1, (answer) => {
    console.log(`今天是${arr[index]},你要做${answer}。`)

    console.log("第二个问题：");

    scanner.question("question2", (answer) => {
        console.log(`question2，你的答案：${answer}。`)
        scanner.close();
    })
})

scanner.on("close", () => {
    // console.log('close.');
    // scanner.close();
})

console.log('dafdfdasfdfafd fda fdsa fdas  ');